{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from nltk.corpus import brown    #获取布朗语料库\n",
    "print(\"布朗语料库的类别：\")\n",
    "print(brown.categories())        #查看布朗语料库的类别\n",
    "#查看布朗语料库news类别中的文件\n",
    "print(\"布朗语料库“news”类别中的文件：\")\n",
    "print(brown.fileids(categories='news'))\n",
    "#查看布朗语料库news类别中的词汇\n",
    "print(\"布朗语料库“news”类别中的词汇：\")\n",
    "print(brown.words(categories='news'))\n",
    "#查看布朗语料库news类别中的句子\n",
    "print(\"布朗语料库“news”类别中的句子：\")\n",
    "print(brown.f(categories='news'))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
